package com.qf.controller;

import com.qf.pojo.resp.BaseResp;
import com.qf.service.MovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/movie")
public class MovieController {
    @Autowired
    MovieService movieService;
    @RequestMapping("/findAll")
    public BaseResp findAll(){
        BaseResp all = movieService.findAll();
        return all;
    }

    @RequestMapping("/findMovieById/{id}")
    public BaseResp findById(@PathVariable("id")Integer movieId){
        return movieService.findMovieById(movieId);
    }
    @RequestMapping("/findByUserComment/{id}/{page}/{size}")
    public BaseResp findByUserComment(@PathVariable("id")Integer id,
                                      @PathVariable("page")Integer page,
                                      @PathVariable("size")Integer size){
        return movieService.findByUserComment(id,page,size);
    }

    @RequestMapping("/findMovieByType/{id}")
    public BaseResp findMovieByType(@PathVariable("id")Integer typeId){
        return movieService.findMovieByType(typeId);
    }

}
